﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class LevelHideLevelId : MonoBehaviour
{
    public Button levelIdButton;
    public Text levelIdText;
    public GameLevelItem gameLevelItem;
    public Text loveText;
    public Button loveButton;
    private int tempId = 1;
    // Start is called before the first frame update
    void Start()
    {
        loveButton.enabled = false;
        levelIdText.text = tempId.ToString();
        levelIdButton.onClick.AddListener(() =>
        {
            
            LevelIdButtonClick();
        });

    }

    private void LevelIdButtonClick()
    {
        tempId++;
        if (tempId <= gameLevelItem.levelId)
            SoundManager.Instance.PlayAudio(SoundType.Click.ToString(), false);
        if (tempId >= gameLevelItem.levelId)
        {
            tempId = gameLevelItem.levelId;
            loveText.color = Color.black;
            loveButton.enabled = true;
        }
        
        levelIdText.text = tempId.ToString();
    }

}
